<?php
$T->loadTpl("./html/".$template."/".$qname.".html");
$T->SetTpl('cssjs','html/cssjs.inc'); 
$T->SetTpl('jsmodel','html/jsmodel.inc');     

$id=isset($_GET["id"])?$_GET["id"]:"0";
        
if($id!="0"){  
    $role=$T->db->query("select * from sys_role where id=".$id)->fetch(PDO::FETCH_ASSOC);
    $T->Set("rolename",$role["rolename"]);
    $T->Set("id",$role["id"]);
    $role_menu=$T->db->query("select * from sys_role_menu where rid=".$id)->fetch(PDO::FETCH_ASSOC);
    if($role_menu){
        $T->Set("menu_id",$role_menu["menu_id"]);
    }else{
        $T->Set("menu_id","");
    }
}  


$T->Set("template",$template);         
$T->clearNaN();       
$T->clearNoN();
$T->display(); 